
import java.util.*;

public class list {
    static class ListNode
    {
        int cur;
       ListNode next=null;

        public ListNode(int cur) {
            this.cur = cur;
        }
    }
    public ListNode head;
    public ListNode creat()
    {
        ListNode a1=new ListNode(1);

        head=a1;
        return head;
    }
    public ListNode deleteDuplication(ListNode pHead) {
        if(pHead==null)
        {
            return null;
        }
        ListNode b=new ListNode(-1);
        b.next=pHead;
        ListNode cur=b;
        HashMap<ListNode,Integer>c=new HashMap<>();
        while(cur!=null)
        {
            if(!c.containsKey(cur))
            {
                c.put(cur,1);

            }
            else
            {
                Integer m=c.get(cur);
                c.put(cur,m+1);
            }
            cur=cur.next;


        }
        ListNode f=b;
        cur=b.next;

        while(cur!=null)
        {
            if(c.get(cur)==1)
            {
                f.next=cur;
                f=cur;

            }
            cur=cur.next;

        }
        return f.next;



    }


}
class text15
{
    public static void main(String[] args) {
        list a=new list();

        list .ListNode m=a.deleteDuplication(a.creat());
        System.out.println(1);
    }
}
